//
//  OAApproveDetailsVC.m
//  OA项目
//
//  Created by innofive on 2018/4/16.
//  Copyright © 2018年 inno. All rights reserved.
//

#import "OAApproveDetailsVC.h"
#import "OAApprovelistCell.h"
#import "UIBarButtonItem+Extension.h"
#import "OAApproveRejectedVC.h"
@interface OAApproveDetailsVC ()



@end


@implementation OAApproveDetailsVC

- (void)viewDidLoad {
    [super viewDidLoad];
    

    
    UIBarButtonItem *rightItem =[UIBarButtonItem OnCreateBarBtnItemName:@"休假历史" BarBtnstyle:(RightBarBtnItemStyle) Btntag:10 target:self action:@selector(onRightButton:)];
    self.navigationItem.rightBarButtonItem = rightItem;
    
    NSArray *arr = @[@{@"name1":@"状态",@"name2":@"待审批"},
                     @{@"name1":@"请假人",@"name2":@"刘华华"},
                     @{@"name1":@"假别",@"name2":@"调休",@"name3":@"此假别本年尚未休过"},
                     @{@"name1":@"事由",@"name2":@"加班调休"},
                     @{@"name1":@"起始时间",@"name2":@"2017-11-29 09:00"},
                     @{@"name1":@"终止时间",@"name2":@"2017-11-30 18:00"},
                     @{@"name1":@"合计",@"name2":@"1天0小时"},
                     @{@"name1":@"提交片时间",@"name2":@"2017-11-28 09:00"},
                     @{@"name1":@"已审批人",@"name2":@"无"},
                     @{@"name1":@"下一审批人",@"name2":@"小小"},
                     @{@"name1":@"",@"name2":@""},
                     @{@"name1":@"抄送",@"name2":@""},
                     @{@"name1":@"",@"name2":@""},
                     ];
    
    [self.dataArr addObjectsFromArray:arr];
    
    
}

-(void)onLoadViewByWillAppear:(UIView *)view
{
    [self.tableView config:^(UITableView *tableView) {
        [tableView setSeparatorMan];
    }];
}

#pragma mark - 点击方法
-(void)onRightButton:(UIButton *)button
{
    
}

-(void)onClick:(UIButton *)button
{
    
    OAApproveRejectedVC *vc =[OAApproveRejectedVC rejectedVCForType:button.tag==20?openVCTypeOne:openVCTypeTwo];
    
    [self presentWindowToVC:vc IsNaV:NO Completion:^{
        
    }];
}


-(MCCellInfo *)tableView:(UITableView *)tableView cellForIndexPath:(NSIndexPath *)indexPath IsHeight:(BOOL)isheight
{
    if (indexPath.row==1||indexPath.row==9||indexPath.row==11) {
         return [MCCellInfo configForCellId:cell Class:[OAApproveDetailsCell class] Height:kFitH(40) TableView:tableView];
    }
    else if (indexPath.row==2)
    {
        return [MCCellInfo configForCellId:cell4 Class:[OAApproveDetailsCell4 class] Height:kFitH(60) TableView:tableView];
        
    }
    else if (indexPath.row==3)
    {
        return [MCCellInfo configForCellId:cell5 Class:[OAApproveDetailsCell5 class] Height:kFitH(80) TableView:tableView];
        
    }
    else if (indexPath.row==10)
    {
        return [MCCellInfo configForCellId:cell6 Class:[OAApproveDetailsCell1 class] Height:kFitH(5) TableView:tableView];
        
    }
    else if (indexPath.row==self.dataArr.count-1)
    {
        return [MCCellInfo configForCellId:cell3 Class:[OAApproveDetailsCell3 class] Height:kFitH(85) TableView:tableView];
        
    }
     return [MCCellInfo configForCellId:cell2 Class:[OAApproveDetailsCell class] Height:kFitH(40) TableView:tableView];
}


#pragma mark - Table view data source

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
